import AjaxPlugin from '@/http'
import { querystring } from 'vux'

// 获取所有文章
export const fetchArticles = () => {
  return AjaxPlugin.$http.get(`/v1/article`).then(r => r.data)
}

// 获取类型文章
export const fetchArticleStatus = (data) => {
  return AjaxPlugin.$http.get(`/v1/article?` + querystring.stringify(data)).then(r => r.data)
}

// 获取指定文章内容
export const fetchArticle = (id) => {
  return AjaxPlugin.$http.get(`/v1/article/` + id).then(r => r.data)
}
